package cn.livenovel.thirddata;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

import cn.livenovel.thirddata.lottery.LotteryDataCollect;
import cn.livenovel.thirddata.lottery.LotteryStatisticsService;

/**
 * 启动类
 * 
 * @author shaohui
 * @date 2017-06-14 14:19:24
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class Application {

    public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, IOException {
        ConfigurableApplicationContext context = SpringApplication.run(Application.class);
        LotteryDataCollect lotteryDataCollect = context.getBean(LotteryDataCollect.class);
        lotteryDataCollect.importFromFile(new File("C:\\Users\\shaohui\\Desktop\\lotto"));
        LotteryStatisticsService lotteryStatisticsService = context.getBean(LotteryStatisticsService.class);
        lotteryStatisticsService.statisticUnionLottos();
    }
    
}
